<%@page import="java.util.Arrays"%>
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]-->
<!DOCTYPE html>    
<%@page import="java.util.Enumeration"%>

<%


    if (request.getAttribute("items") == null) {

%>
<jsp:forward page="celona"/>
<%}


    String[] itemsArray = (String[]) request.getAttribute("items");
    String items = returnArray(itemsArray);

    String[] itemsStylesArray = (String[]) request.getAttribute("items_styles");
    String itemsStyles = returnArray(itemsStylesArray);



    String[] itemsArrays = (String[]) request.getAttribute("state_items");
    String itemss = returnArray(itemsArrays);



    String[] itemsStylesArrays = (String[]) request.getAttribute("items_styless");
    String itemsStyless = returnArray(itemsStylesArrays);


    String[] topologyItems = (String[]) request.getAttribute("topology_items");
    String topologyItemses = returnArray(topologyItems);


    String[] topologyItemsStyles = (String[]) request.getAttribute("topology_itemsStyles");
    String topologyItemsStyleses = returnArray(topologyItemsStyles);






    String[] sqlNameTestes = (String[]) request.getAttribute("sql_names");
    String sqlNameTest = returnArray(sqlNameTestes);


    String[] sqlNameValues = (String[]) request.getAttribute("sql_name_values");
    String sqlNameValue = returnArray(sqlNameValues);


    String[] systemEntityTextes = (String[]) request.getAttribute("system_entities");
    String systemEntityText = returnArray(systemEntityTextes);

    String[] systemEntityValues = (String[]) request.getAttribute("system_entity_values");
    String systemEntityValue = returnArray(systemEntityValues);





    String evolveLink = (String) request.getAttribute("evolveLink");

    itemsStyles = itemsStyles.replaceAll("#", "");

    //out.print(itemsStyles);
/*
     String type = request.getParameter("type");
     HttpSession s = request.getSession(true);
     s.setAttribute(type, "");
     s.removeAttribute(type);*/

    Enumeration keys = session.getAttributeNames();
    while (keys.hasMoreElements()) {
        String key = (String) keys.nextElement();

        session.removeAttribute(key);
    }

%> 



<html>
    <head>
        <title>Celona - Cetool Demo</title>


        <link href="style/style.css" rel="stylesheet">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="includes/js/jquery.js"></script>



    </head>
    <body >

        <div class='home'>

            <button class='homebt'></button>

            <div class='home_data'>
                <a target="_blank" href="<%=evolveLink%>" class='logo'></a>
                <div class='homeTitle'>Evolve Configurator</div>


                <div class='homedes'></div>

            </div>

            <div class='mainTabs'>
                <div class="act topolgy" id="c3"></div>
                <div  class='itemo_peration'id="c6"></div>
                <div  class='managed_item' id="c5"> </div>
                <div class="row"></div>
                <div  class="dependency"id="c4"> </div>
                <div  clas='status_modle' id="c2"></div>
                <div  clas='model_direction' id="c1"></div>


            </div>


            <div class='footerRight'>Version 4.2(a)</div>
            <div class='footerLeft'>&COPY;2012 - CTL Technologies Ltd. </div>

        </div>








        <div id ="edit2" class="geEditor5 c5 cdiv"> 






            <iframe  id='Managedframe'class="editorframe" src="
                     managededItem.jsp?items=<%=topologyItemses%>
                     &itemsstyles=<%=topologyItemsStyleses%>
                     &sqlNameTest=<%=sqlNameTest%>
                     &sqlNameValue=<%=sqlNameValue%>
                     &systemEntityText=<%=systemEntityText%>
                     &systemEntityValue=<%=systemEntityValue%>&openstatus=1"></iframe>



        </div>


        <div id ="edit6" class="geEditor6 c6 cdiv"> 


            <iframe id='itemoPerationframe' class="editorframe" src="itemOperation.jsp?items=<%=itemss%>&itemsstyles=<%=itemsStyless%>&openstatus=1"></iframe>



        </div>



        <div  id ="edit1"class="geEditor c1 cdiv">
            <iframe id='modelDirection' class="editorframe" src="directedModelEditor.jsp?items=<%=items%>&itemsstyles=<%=itemsStyles%>"></iframe>
        </div>

        <div  id ="edit4"class="geEditor4 c4 cdiv">
            <iframe id='dependencyEditor' class="editorframe" src="dependencyEditor.jsp?items=<%=items%>&itemsstyles=<%=itemsStyles%>"></iframe>
        </div>



        <div id ="edit2" class="geEditor2 c2 cdiv"> 


            <iframe class="editorframe" src="stateModeleditor.jsp?items=<%=itemss%>&itemsstyles=<%=itemsStyless%>"></iframe>

        </div>


        <div id ="edit3" class="geEditor3 c3 cdiv"> 


            <iframe class="editorframe" src="
                    topologyEditor.jsp?items=<%=topologyItemses%>
                    &itemsstyles=<%=topologyItemsStyleses%>
                    &sqlNameTest=<%=sqlNameTest%>
                    &sqlNameValue=<%=sqlNameValue%>
                    &systemEntityText=<%=systemEntityText%>
                    &systemEntityValue=<%=systemEntityValue%>"></iframe>

        </div>


    </body>








    <%!
        String returnArray(String[] myArray) {


            String returnData = "";
            for (int i = 0; i < myArray.length; i++) {


                returnData += myArray[i] + "__";

            }


            return returnData;
        }
    %>




</head>


</html>




<div class='valueupdate'> </div>


<div class="proects_p"> 
    <div class="proects">

    </div>
</div>

<div class='itmedata'></div>


<div class='moditmedata'> 
    <input type='hidden' value="" class='mmodmyitemdata' />
    <input type='hidden' value="" class='mToSystem' />
    <input type='hidden' value="" class='mFromSystem' />


</div>


<div class='forhimages'>
    <div class='data1'></div>
    <div class='data2'></div>
    <div class='data3'></div>
    <div class='data4'></div>
    <div class='data5'></div>
    <div class='data6'></div>
    <div class='data7'></div>
    <div class='data8'></div>


</div> 

</div>

<script>
    $(function() {


        var homeSatatus = 0;



        function homeOpen() {



            $(".homebt").removeClass("open");


            $('.home').animate({


                left: '10%'
            }, 800, function() {

            });

            homeSatatus = 0;

        }



        function homeClose() {
            $(".homebt").addClass("open");

            $('.home').animate({


                left: '100%'
            }, 800, function() {

            });

            homeSatatus = 1;

        }




        $(".homebt").click(function() {

            if (homeSatatus == 0) {
                homeClose();
            } else {


                homeOpen();

            }


        })








        $(".mainTabs div").click(function() {
            $(".mainTabs div").removeClass("act");


            $(this).addClass("act");
            var id = $(this).attr("id");



            $(".cdiv").stop(true, true).hide(1000);

            $("." + id).stop(true, true).show(1000, function() {


                if (id == "c1") {

                    var iframe = document.getElementById("modelDirection");
                    iframe.contentWindow.showModelDirectionWidows("");
                }


                if (id == "c4") {

                    var iframe = document.getElementById("dependencyEditor");
                    iframe.contentWindow.dependencyEditorFun("");
                }



                if (id == "c6") {

                    var iframe = document.getElementById("itemoPerationframe");
                    iframe.contentWindow.itemoPerationShow("");
                }

                if (id == "c5") {

                    var iframe = document.getElementById("Managedframe");
                    iframe.contentWindow.ManagedItemsShow("");
                }




            });

            homeClose();

        })
    })

</script>












